import { View } from 'react-native';
import React from 'react';
import PropTypes from 'prop-types';
import { WingBlank } from '@ant-design/react-native';
import Item from '../Item';

const List = ({
    navigation, getList, noteList, bookid,
}) => (
    <View>
        <WingBlank>
            <View style={{
                flexDirection: 'row',
                flexWrap: 'wrap',
                justifyContent: 'space-between',
            }}
            >
                {
                    noteList.map(objItem => (
                        <Item
                            navigation={navigation}
                            objItem={objItem}
                            getList={getList}
                            title={objItem.title}
                            key={objItem.noteid}
                            bookid={bookid}
                        />
                    ))
                }
            </View>
        </WingBlank>
    </View>
);
List.defaultProps = {
    noteList: [],
    bookid: null,
    getList: () => {},
};
List.propTypes = {
    noteList: PropTypes.arrayOf(PropTypes.any),
    bookid: PropTypes.string,
    getList: PropTypes.func,

};
export default List;
